<!DOCTYPE html>
<html lang="fr">
    <head>
        <?php session_start(); ?> 
        <meta charset="utf-8">
        <title>ServerWebOs - Connexion</title>
        <style>            
            *{padding: 0 ; margin: 0; }
            body{background: url(images/bg.png);}
            #form{background: url(images/form.png)no-repeat; width: 420px ; height: 134px ; margin: 0 auto; vertical-align: middle; margin-top: 300px;  }
            #submit{background: url(images/btn.png) no-repeat; position: absolute;  width: 53px ; height: 53px ; border: none ; cursor: pointer; margin-top: -20px ; margin-left: 30px;  } 
            .login{border: none; width: 250px ; height: 35px ; margin-left: 90px ; margin-top: 25px ; background: none; color: white; outline : none ;   }
            .pwd{border: none; width: 250px ; height: 35px ; margin-left: 90px ; margin-top: 13px ; background: none; color: white; outline : none ; }

        </style>

        <script src="jquery/jquery-1.6.2.js"></script>
        <script>
            function connect()
            {
                $.ajax({
                    type: "POST",
                    url: "ajax/connect.php",
                    data: "login="+document.getElementById('login').value+"&pwd="+document.getElementById('pwd').value
                }).done(function( msg ) {
                    if(msg =='1') document.location.href='admin.php' ; 
                     else document.getElementById('error').value = 'Identifiants incorrects' ; 
                });
            }
        </script>
    <body>
        <noscript style="font-size: 25px ;color: red; ">Aucun javascript n'est activé. L'accès à la plateforme vous est donc impossible.</noscript>
        <section id="form">
            <div id="error"></div>
            <input class="login" type="text" id="login"  onKeyPress="if(event.keyCode == 13) connect()"/>
            <input class="pwd" type="password" id="pwd"  onKeyPress="if(event.keyCode == 13) connect()"/>
            <input type="button" id="submit" onclick="connect()"/>
        </section>
        <div id="log"></div>
    </body>
</html>
